import {
  UpdateInfoReq, IRes, RemoveThingInfoReq, AddThingInfoReq, GetThingInfoReq
} from '../type/thingInfo'
import $http from '@/utils/http/index'

/**
 * 修改启事信息
 * @param data 
 * @returns 
 */
export function updateThingInfo(data: UpdateInfoReq) {
  return $http.patch<IRes>({
    url: "/api/thing/updateInfoById",
    data
  });
}

/**
 * 增加启事信息
 * @param data 
 * @returns 
 */
export function addThingInfo(data: AddThingInfoReq) {
  return $http.post<IRes>({
    url: "/api/thing/public",
    data
  });
}

/**
 * 删除启事信息
 * @param data 
 * @returns 
 */
export function removeThingInfo(data: RemoveThingInfoReq) {
  return $http.patch<IRes>({
    url: "/api/thing/removeThingInfo",
    data
  });
}

/**
 * 获取启事信息
 * @param data 
 * @returns 
 */
export function getThingInfo(data: GetThingInfoReq) {
  return $http.get<IRes>({
    url: "/api/thing/getAllThingInfo",
    params: data
  });
}